POV-Ray : Newsgroups : povray.advanced-users : Re: What is the frontside of a triangle? : Re: What is the frontside of a triangle? Server Time
29 Jul 2024 00:34:11 EDT (-0400)
  Re: What is the frontside of a triangle?  
From: Jaap Frank
Date: 8 Jul 2003 17:07:37
Message: <3f0b3299$1@news.povray.org>
"Shay" <sah### [at] simcopartscom> wrote in message news:3f0b192e@news.povray.org...
>
> Cut and paste this code:
>
> camera {location <0,0,-5>  look_at <0,0,0>}
>
>   texture{OuTex} interior_texture{InTex}
>   .....
>   translate <0,-1,0>
> }
>
I've changed some things.
The union is plane wrong. The order of transformations
give different results too.
But I think something goes wrong with the mesh too.
If the order of the vertices fixes the front side, then
rotation should give the other sides, but this does not happen,
or am I thinking wrong?

// Changed code of Shay:
camera {location <0,0,-8>  look_at <0,0,0>}

#local P1a = <-2,2.5,0>;
#local P2a = <0,2.5,0>;
#local P3a = <-1,3.5,0>;

#local P1b = P1a+<2,0,0>;
#local P2b = P2a+<2,0,0>;
#local P3b = P3a+<2,0,0>;

#local T = <0,4,0>;

#local OuTex = texture{pigment{rgb <1,0,0>}finish{ambient 1}}
#local InTex = texture{pigment{rgb <0,1,0>}finish{ambient 1}}

union { // ignores point order
  triangle {P1a, P2a, P3a}
  triangle {P1b, P3b, P2b}
  texture{OuTex} interior_texture{InTex}
}

union { // ignores point order
  triangle {P1a, P2a, P3a}
  triangle {P1b, P3b, P2b}
  texture{OuTex} interior_texture{InTex}
  translate <0,-1,0>  rotate <0,180,0>
}

union { // ignores point order
  triangle {P1a, P2a, P3a}
  triangle {P1b, P3b, P2b}
  texture{OuTex} interior_texture{InTex}
   rotate <0,180,0> translate <0,-2,0>
}

mesh { // uses point order
  triangle {P1a-T, P2a-T, P3a-T}
  triangle {P1b-T, P3b-T, P2b-T}
  texture{OuTex} interior_texture{InTex}
}

mesh { // uses point order
  triangle {P1a-T, P2a-T, P3a-T}
  triangle {P1b-T, P3b-T, P2b-T}
  texture{OuTex} interior_texture{InTex}
  rotate <0,180,0> translate <0,-1,0>
}

mesh { // uses point order
  triangle {P1a-T, P2a-T, P3a-T}
  triangle {P1b-T, P3b-T, P2b-T}
  texture{OuTex} interior_texture{InTex}
  translate <0,-2,0> rotate <0,180,0>
}


Jaap Frank


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.